package com.dingwen.treasure.business.controller;

import com.dingwen.treasure.base.controller.BaseViewController;
import com.dingwen.treasure.base.pojo.vo.Result;
import com.dingwen.treasure.business.service.YueService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 微信公众号API
 *
 * @author dingwen
 * @date 2022/12/29
 */
@Api(tags = "微信公众号API")
@RestController
@Slf4j
@RequestMapping("wechat-pub")
public class WechatPubController implements BaseViewController {

    @Resource
    private YueService yueService;


    @ApiOperationSupport(author = "dingwen")
    @ApiOperation("月早安通知立即发送")
    @PutMapping("/morning")
    public Result<String> immediatelySendMorning() {
        yueService.goodMorning();
        return success();
    }

    @ApiOperationSupport(author = "dingwen")
    @ApiOperation("月晚安通知立即发送")
    @PutMapping("/night")
    public Result<String> immediatelySendNight() {
        yueService.goodNight();
        return success();
    }
}
